package cn.wikiflyer.beikang.net;

import java.util.ArrayList;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import com.alipay.sdk.util.LogUtils;
import com.baidu.navisdk.util.common.LogUtil;
import com.umeng.common.message.Log;

import android.content.Context;
import android.text.TextUtils;
import cn.wk.libs4a.WKApplication;
import cn.wk.libs4a.net.WKHttpRequest;
import cn.wk.libs4a.utils.L;

/**
 * @author maizi
 * 
 */
public class HttpRequest extends WKHttpRequest {

	public HttpRequest(Context context) {
		super(context);
	}

	/**
	 * DEMO
	 */
	public String GetMerchantInfo(String posCode) {
		try {
			ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("posCode", posCode));
			params.add(new BasicNameValuePair("operator", app().sp
					.getString("operator")));// 添加操作员
			String url = WKApplication.BASE_URL + "GetMerchantInfo";
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 设置默认
	 * 
	 * http://bk.ngrok.io/index.php?m=api&c=bankcard&a=setDefault&cardid={1}
	 */
	public String setDefault(String cardid) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("bankcard",
					"setDefault", "");
			params.add(new BasicNameValuePair("cardid", cardid));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 提现列表 http://bk.ngrok.io/index.php?m=api&c=deposit&a=getApplyLogs
	 */
	public String tixian(boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("deposit",
					"getApplyLogs", "");
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 提现 http://bk.ngrok.io/index.php?m=api&c=deposit&a=apply
	 * 
	 * 输入参数 money 提现金额 cardid 银行卡id
	 */
	public String giveMeMoney(String money, String cardid) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("deposit", "apply", "");
			params.add(new BasicNameValuePair("money", money));
			params.add(new BasicNameValuePair("cardid", cardid));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 银行卡列表 getBankCards
	 */
	public String getBankCards(boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("bankcard",
					"getBankCards", "");
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 删除银行卡号
	 */
	public String delBankCard(String cardid) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("bankcard", "del", "");
			params.add(new BasicNameValuePair("cardid", cardid));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 编辑银行卡号
	 */
	public String updateBankCard(String cardName, String cardNumber,
			String bankName, String is_default) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("bankcard", "bind", "");
			params.add(new BasicNameValuePair("cardName", cardName));
			params.add(new BasicNameValuePair("cardNumber", cardNumber));
			params.add(new BasicNameValuePair("bankName", bankName));
			params.add(new BasicNameValuePair("is_default", is_default));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 个人信息
	 * 
	 * http://bk.ngrok.io/index.php?m=api&c=member&a=myMemberCenter
	 */
	public String userInfo(boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member",
					"myMemberCenter", "");
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 申请短信验证码
	 */
	public String send_verify(String mobile, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("sms", "send_verify",
					"");
			params.add(new BasicNameValuePair("mobile", mobile));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 产品列表
	 */
	public String getProductList(boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("content", "lists",
					"6");
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 产品详细信息
	 */
	public String getProductInfo(String id, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("content", "content",
					"6");
			params.add(new BasicNameValuePair("id", id));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 引导页广告
	 */
	public String getAd(boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("ad", "lists", "8");
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取首页数据
	 */
	public String getIndex(boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("index", "index", "");
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 分享相关
	 */
	public String getShare(boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("system", "shareInfo",
					"");
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取公告列表 page_num 请求的页码，不填默认1 rows 每页记录数，不填默认20
	 */
	public String getNews(String page_num, String rows, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("content", "lists",
					"10");
			params.add(new BasicNameValuePair("page_num", page_num));
			params.add(new BasicNameValuePair("rows", rows));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取咨询详情
	 */
	public String getNewsDetail(String catid, String id, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("content", "content",
					"" + catid);
			params.add(new BasicNameValuePair("id", "" + id));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 意见反馈接口
	 */
	public String postFeedBack(String msg) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("feedback",
					"feedback", "");
			params.add(new BasicNameValuePair("msg", msg));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取通知列表
	 */
	public String getNoticeList(String status, int page_num, int rows,
			boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member", "inbox", "");
			if (status != null && !status.equals("")) {
				params.add(new BasicNameValuePair("status", status));
			}
			params.add(new BasicNameValuePair("page_num", "" + page_num));
			params.add(new BasicNameValuePair("rows", "" + rows));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 读取通知接口
	 */
	public String readNotice(String messageid) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member",
					"readMessage", "");
			params.add(new BasicNameValuePair("messageid", messageid));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 帮助中心接口（了解倍康）
	 */
	public String getHelp(String catid, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("content", "page",
					catid);
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取购物车列表数据
	 */
	public String getShopList(int page_num, int rows, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("cart", "lists", "");
			params.add(new BasicNameValuePair("page_num", "" + page_num));
			params.add(new BasicNameValuePair("rows", "" + rows));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 注册 输入参数
	 * 
	 * http://bk.ngrok.io/index.php?m=api&c=member&a=register
	 * 
	 * mobile 手机号
	 * 
	 * password 密码
	 * 
	 * mobile_verify 短信验证码
	 * 
	 * parent_code 邀请码
	 */
	public String register(String mobile, String password,
			String mobile_verify, String parent_code) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member", "register",
					"");
			params.add(new BasicNameValuePair("mobile", mobile));
			params.add(new BasicNameValuePair("password", password));
			params.add(new BasicNameValuePair("mobile_verify", mobile_verify));
			params.add(new BasicNameValuePair("parent_code", parent_code));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 登录 接口：login * 参数：name, password(用户名，密码) 修改——phone_number_login
	 */
	public String login(String username, String password) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member", "login", "");
			params.add(new BasicNameValuePair("username", username));
			params.add(new BasicNameValuePair("password", password));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 注销退出接口 登出接口
	 */
	public String loginOut() {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member", "logout", "");
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 添加购物车接口
	 */
	public String postAddCart(String goods_id, String quantity) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("cart", "add", "");
			params.add(new BasicNameValuePair("goods_id", goods_id));
			params.add(new BasicNameValuePair("quantity", quantity));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 删除购物车商品接口
	 */
	public String deleteCart(String cartid) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("cart", "del", "");
			params.add(new BasicNameValuePair("cartid", cartid));
			return getConnRequestHttp(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取地址列表
	 */
	public String getAddressList(boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("address", "lists", "");
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 添加收货地址
	 */
	public String addAddress(String sheng, String shi, String qu,
			String address, String phone, String receiver, int default_add) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("address", "add", "");
			params.add(new BasicNameValuePair("sheng", sheng));
			params.add(new BasicNameValuePair("shi", shi));
			params.add(new BasicNameValuePair("qu", qu));
			params.add(new BasicNameValuePair("address", address));
			params.add(new BasicNameValuePair("phone", phone));
			params.add(new BasicNameValuePair("receiver", receiver));
			params.add(new BasicNameValuePair("default_add", "" + default_add));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 编辑收货地址
	 */
	public String editAddress(String addid, String sheng, String shi,
			String qu, String address, String phone, String receiver,
			int default_add) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("address", "edit", "");
			params.add(new BasicNameValuePair("addid", addid));
			params.add(new BasicNameValuePair("sheng", sheng));
			params.add(new BasicNameValuePair("shi", shi));
			params.add(new BasicNameValuePair("qu", qu));
			params.add(new BasicNameValuePair("address", address));
			params.add(new BasicNameValuePair("phone", phone));
			params.add(new BasicNameValuePair("receiver", receiver));
			params.add(new BasicNameValuePair("default_add", "" + default_add));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 删除收货地址
	 */
	public String deleteAddress(String addid) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("address", "del", "");
			params.add(new BasicNameValuePair("addid", addid));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 设为默认地址接口
	 */
	public String defaultAddress(String addid) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("address",
					"setDefault", "");
			params.add(new BasicNameValuePair("addid", addid));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取我的订单列表
	 */
	public String getOrderList(int page_num, int rows, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("orders", "lists", "");
			params.add(new BasicNameValuePair("page_num", "" + page_num));
			params.add(new BasicNameValuePair("rows", "" + rows));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取订单详情
	 */
	public String getOrderInfo(String orderno, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("orders", "info", "");
			params.add(new BasicNameValuePair("orderno", orderno));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 更新购物车内商品数量
	 */
	public String updateOrderNum(String cartid, String quantity) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("cart", "editNum", "");
			params.add(new BasicNameValuePair("cartid", cartid));
			params.add(new BasicNameValuePair("quantity", quantity));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 提交订单接口
	 */
	public String postOrder(String cart_ids, String add_id,int pay_type) {
		L.wj("cart_ids:"+cart_ids+"   add_id:"+add_id+"   pay_type:"+pay_type);
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("orders", "create", "");
			params.add(new BasicNameValuePair("cart_ids", cart_ids));
			params.add(new BasicNameValuePair("add_id", add_id));
			params.add(new BasicNameValuePair("pay_type", ""+pay_type));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 收入订单列表接口
	 */
	public String getInComeList(int page_num, int rows,boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("orders",
					"income_log", "");
			params.add(new BasicNameValuePair("page_num", "" + page_num));
			params.add(new BasicNameValuePair("rows", "" + rows));
			return getConnRequest(getParams(params), url,isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 收支接口
	 */
	public String getBalance(int page_num, int rows, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("orders", "ie_log", "");
			params.add(new BasicNameValuePair("page_num", "" + page_num));
			params.add(new BasicNameValuePair("rows", "" + rows));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 确认收货
	 */
	public String confirmReceipt(String orderno) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("orders",
					"confirm_receipt", "");
			params.add(new BasicNameValuePair("orderno", "" + orderno));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取学习分类接口
	 */
	public String getStudyCate() {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("content", "category",
					"19");
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取学习列表接口
	 */
	public String getStudyList(String catid, int page_num, int rows,
			boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("content", "lists", ""
					+ catid);
			params.add(new BasicNameValuePair("catid", "" + catid));
			params.add(new BasicNameValuePair("page_num", "" + page_num));
			params.add(new BasicNameValuePair("rows", "" + rows));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取学习详情接口
	 */
	public String getStudyInfo(String id) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("content", "content",
					"" + 20);
			params.add(new BasicNameValuePair("id", "" + id));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取头像的Url
	 */
	public String getAvatorUrl() {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member",
					"getAvatarupurl", "" + 20);
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取版本号
	 */
	public String get_version() {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("system",
					"lastVersion", "");
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * @return 修改密码
	 */
	public String modifyPassWord(String oldPsw, String newPsw, String code) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member",
					"change_pwd", "");
			params.add(new BasicNameValuePair("newpwd", "" + newPsw));
			params.add(new BasicNameValuePair("pwd", "" + oldPsw));
			params.add(new BasicNameValuePair("mobile_verify", "" + code));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * @return 修改用户昵称
	 */
	public String modifyName(String nickname) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member",
					"editprofile", "");
			params.add(new BasicNameValuePair("nickname", "" + nickname));
			return postConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * @return 修改手机号
	 */
	public String modifyPhone() {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("", "", "");
			params.add(new BasicNameValuePair("", ""));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 用户晋升接口
	 */
	public String userUpgrade() {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member", "upgrade",
					"");
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 获取我名下的会员
	 */
	public String getVipMember(int page_num, int rows, boolean... isLocal) {
		try {
			String url = WKApplication.BASE_URL + "";
			ArrayList<NameValuePair> params = initParams("member", "myMember",
					"");
			params.add(new BasicNameValuePair("page_num", "" + page_num));
			params.add(new BasicNameValuePair("rows", "" + rows));
			return getConnRequest(getParams(params), url, isLocal);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}

	/**
	 * 设置Params的属性。m:固定api，c，a，catid
	 */
	private ArrayList<NameValuePair> initParams(String c, String a, String catid) {
		ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("m", "api"));
		if (!TextUtils.isEmpty(c)) {
			params.add(new BasicNameValuePair("c", c));
		}
		if (!TextUtils.isEmpty(a)) {
			params.add(new BasicNameValuePair("a", a));
		}
		if (!TextUtils.isEmpty(catid)) {
			params.add(new BasicNameValuePair("catid", catid));
		}
		return params;
	}

	/****************************** 上面是倍康的******************************** */
	/**
	 * 找回密码 接口：update_psw * 参数：phone, code, password
	 */
	public String update_psw(String phone, String code, String password) {
		try {
			String url = WKApplication.BASE_URL + "reset_psw";
			ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();
			params.add(new BasicNameValuePair("phone", phone));
			params.add(new BasicNameValuePair("code", code));
			params.add(new BasicNameValuePair("password", password));
			return getConnRequest(getParams(params), url);
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}
}
